package com.aabte.springcloudlearn.ribboncustomerdemo.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;

/**
 * @author Daniel
 */
@Slf4j
@RestController
public class RibbonCustomerController {

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/ribbon-customer")
    public String helloCustomer(){
        log.info("Start helloCustomer.");
        return restTemplate.getForEntity("http://hello-service/hello", String.class).getBody();
    }

}
